package com.sky.mapper;

import com.sky.dto.GoodsSalesDTO;
import com.sky.entity.Orders;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
* @author 马毅爽
* @description 针对表【orders(订单表)】的数据库操作Mapper
* @createDate 2023-11-09 20:56:39
* @Entity com.sky.entity.Orders
*/
public interface OrdersMapper extends BaseMapper<Orders> {

    @Select("select * from orders where number = #{orderNumber}")
    Orders getByNumber(String orderNumber);

    Double sumByMap(Map<String, Object> map);

    Integer countByMap(Map<String, Object> map);

    List<GoodsSalesDTO> getSalesTop(LocalDateTime begin, LocalDateTime end);

    Integer countByStatus(Integer status);
}




